<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<title>User view</title>
    <c:url value="/js/jquery-1.3.2.min.js" var="url"/>
    <script type="text/javascript" src="${url}"> </script>
    <c:url value="/js/user_form.js" var="url"/>
    <script type="text/javascript" src="${url}"> </script>
</head>
<body>
<div style="float: left; margin: 5px;" >
	<c:url value="/photo/${user.id}" var="url"/> 
    <img src="${url}" alt="photo" style="width: 200px;" id="photo">
    <br/>
   	<c:url value="/user/${user.id}/edit" var="url"/>
    <a href="${url}">Редактировать</a>
</div>
<div style="float: left">
	<c:url value="/user/list" var="url"/>
    <a href="${url}">К списку пользователей</a>
    <table>
        <%--<tr><td>ФИО</td><td><c:out value="${user.lastName}"/> <c:out value="${user.firstName}"/> <c:out value="${user.patrName}"/></td></tr>--%>
        <tr><td>ФИО</td><td><c:out value="${user.lastName} ${user.firstName} ${user.patrName}"/></td></tr>
		<fmt:formatDate value="${user.dateOfBirth}" pattern="dd.MM.yyyy" var="date"/>
		<tr><td>Дата рождения</td><td><c:out value="${date}"/></td></tr>
		<tr><td>Номер телефона</td><td><c:out value="${user.phoneNumber}"/></td></tr>
		<tr><td>E-mail адрес</td><td><c:out value="${user.mail}"/></td></tr>
		<c:if test="${user.student}">
			<tr><td>Характеристика</td><td><c:out value="${user.testimonial}"/></td></tr>
			<tr><td>Группа в университете</td><td><c:out value="${user.universityGroup}"/></td></tr>
			<tr><td>Год выпуска</td><td><c:out value="${user.graduationYear}"/></td></tr>
			<tr><td>Группа</td><td><c:out value="${user.group}"/></td></tr>
			<tr><td>Статус</td><td><c:out value="${user.status}"/></td></tr>
			<c:if test="${user.status eq 'EXPULSION'}">
				<tr><td>Дата отчисления</td><td><c:out value="${user.dateOfExpulsion}"/></td></tr>
			</c:if>
			<tr><td>Текущее место работы</td>
				<td><c:choose>
					<c:when test="${user.accepted}">
						<fmt:formatDate value="${user.dateAccepted}" pattern="dd.MM.yyyy" var="date"/>
						ПрофИтСофт с <c:out value="${date}"/>
					</c:when>
					<c:otherwise><c:out value="${user.currentPlaceOfEmployment}"/></c:otherwise>
				</c:choose></td>
			</tr>
			<c:if test="${user.professor}"><tr><td>
				Преподаватель
			</td></tr></c:if>
			<c:if test="${user.admin}"><tr><td>
				Администратор
			</td></tr></c:if>
			
		</c:if>
	</table>
</div>			
</body>
</html>